package com.example.huaxindemo2.controller;

import com.example.huaxindemo2.entity.Pr102;
import com.example.huaxindemo2.mapper.Pr102Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Controller
public class Pr10201Controller {
    @Autowired
    private Pr102Mapper pr102Mapper;

    @GetMapping("/pr10201")
    public String showOrderForm(Model model) {
        List<Pr102> orders = pr102Mapper.getAllOrders();
        model.addAttribute("orders", orders);
        return "/pr10201";
    }
}
